package com.xjoyt.pay.master.interfaces;

import java.util.List;

import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.xjoyt.pay.dto.ExecuteResult;
import com.xjoyt.pay.dto.PageParam;
import com.xjoyt.pay.dto.PageResult;
import com.xjoyt.pay.master.params.MerchantPageParam;
import com.xjoyt.pay.master.po.Merchant;
import com.xjoyt.pay.master.po.MerchantRate;

public interface MerchantContract {

	@RequestMapping("get/{id}")
	Merchant get(@PathVariable("id") String id);
	
	@RequestMapping("getMerchantRate/{id}")
	List<MerchantRate> getMerchantRate(@PathVariable("id") String id);

	@RequestMapping(value = "loadPage", method = RequestMethod.POST)
	PageResult<Merchant> loadPage(PageParam<MerchantPageParam> param);

	@RequestMapping(value = "update", method = RequestMethod.POST)
	ExecuteResult<?> update(com.xjoyt.pay.merchant.register.po.Merchant param);

	@RequestMapping(value = "create", method = RequestMethod.POST)
	ExecuteResult<?> create(com.xjoyt.pay.merchant.register.po.Merchant param);

	/**
	 * 通过商户号获取商户
	 * 
	 * @param no
	 * @return
	 */
	@RequestMapping("getByNo/{no}")
	Merchant getByNo(@PathVariable("no") String no);

	/**
	 * 通过第三方商户号获取商户
	 * 
	 * @param no
	 * @return
	 */
	@RequestMapping("getByCustomerNo/{distributorId}/{no}")
	Merchant getByDistributorIdAndCustomerNo(@PathVariable("distributorId") String distributorId,
			@PathVariable("no") String no);

	@RequestMapping("resetKey/{id}")
	ExecuteResult<String> resetKey(@PathVariable("id") String id);
}
